package com.bjesc_b2c.app.appraiset.mvp.presenter.impl;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.bean.CompleteOrderBean;
import com.bjesc_b2c.app.appraiset.mvp.model.CompleteOrderModel;
import com.bjesc_b2c.app.appraiset.mvp.model.impl.CompleteOrderModelImpl;
import com.bjesc_b2c.app.appraiset.mvp.presenter.CompleteOrderPresenter;
import com.bjesc_b2c.app.appraiset.mvp.view.CompleteOrderView;

import java.util.List;

/**
 * Created by yidong on 2017/8/8.
 */

public class CompleteOrderPresenterImpl implements CompleteOrderPresenter,CompleteOrderModelImpl.CallBack {
    private CompleteOrderModel model;
    private CompleteOrderView orderView;

    public CompleteOrderPresenterImpl(CompleteOrderView orderView) {
        this.orderView = orderView;
        model = new CompleteOrderModelImpl(this);
    }
    @Override
    public void getCompleteOrderList(Context context, int page, int type, String keyword, int status) {
        model.getCompleteOrderList(context,page,type,keyword,status);
    }

    @Override
    public void getAllOrderList(Context context, int page, int type, String keyword, int status) {
        model.getAllOrderList(context,page,type,keyword,status);
    }

    @Override
    public void callback(List<CompleteOrderBean> bean) {
        orderView.getOrderList(bean);
    }

    @Override
    public void loadStart() {
        orderView.loadStart();
    }

    @Override
    public void loadCompleted() {
        orderView.loadCompleted();
    }

    @Override
    public void loadFailure() {
        orderView.loadFailure();
    }
}
